package com.lxg;

import com.lxg.dao.BookDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 陆小根
 * date: 2022/04/23
 * Description:
 * 单例还是非单例
 */

public class AppForScope {

  public static void main(String[] args) {

    ApplicationContext context =
            new ClassPathXmlApplicationContext("applicationContext.xml");
    BookDao bookDao1 = (BookDao) context.getBean("bookDao");
    BookDao bookDao2 = (BookDao) context.getBean("bookDao");

    System.out.println(bookDao1);
    System.out.println(bookDao2);
  }

}
